<?php

namespace C\L;

class WebUserController extends WebController
{
    protected function checkAuth()
    {
        $authStatus = $this->s_user->getValue('is_auth', $this->uid);
        return $authStatus == 'Y' ? true : $this->error(null, 'E1002');
    }

    public function checkPaymentPassword()
    {
        $paymentPassword = $this->s_user->getValue('pay_pwd', $this->uid);
        return $paymentPassword ? true : $this->error(null, 'E1003');
    }

    protected function checkCanInvest()
    {
        $status = $this->s_user->getValue('status', $this->uid);

        return $status == 'I' ? $this->error(null, 'E1004') : true;
    }

    protected function checkCanWithdraw()
    {
        $status = $this->s_user->getValue('status', $this->uid);

        return $status == 'W' ? $this->error(null, 'E1004') : true;
    }
}
